home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / BARNET / COMPILER / SATHER / !Sather / Library / Containrs / sa / queue < prev    next >
Text File  |  1996-07-16  |  1KB  |  39 lines

  1. ---------------------------> Sather 1.1 source file <--------------------------
  2. -- queue.sa: Standard queue
  3. -- Author: Benedict A. Gomes <gomes@icsi.berkeley.edu>
  4. -- Copyright (C) 1995, International Computer Science Institute
  5. -- $Id: queue.sa,v 1.4 1996/07/16 04:38:16 holger Exp $
  6. --
  7. -- COPYRIGHT NOTICE: This code is provided WITHOUT ANY WARRANTY
  8. -- and is subject to the terms of the SATHER LIBRARY GENERAL PUBLIC
  9. -- LICENSE contained in the file: Sather/Doc/License of the
  10. -- Sather distribution. The license is also available from ICSI,
  11. -- 1947 Center St., Suite 600, Berkeley CA 94704, USA.
  12. -------------------------------------------------------------------
  13. abstract class $QUEUE{T} <  $DISPENSER{T} is
  14.    -- Abstract queue
  15.  
  16.    -- size: INT;
  17.    -- current: T;
  18.    -- remove: T;
  19.    -- Return the topmost element of the queue and advance
  20.    -- str: STR;
  21.    -- copy: SAME;
  22.    -- has(e: T): BOOL;
  23.    
  24.    top: T;
  25.    -- Return the topmost element (alias for current)
  26.    
  27.    enq(elt:T);
  28.    -- Enqueue the element "elt"
  29.    
  30.    is_empty: BOOL;
  31.    -- Is the queue empty
  32.    
  33.    elt!: T;
  34.    -- Return the elements in queue order (without removing them)
  35.    -- i.e. return them in the same order as "remove" would
  36.    
  37. end;
  38. -------------------------------------------------------------------   
  39.